<?py include('templates/base_top.html') ?>
<?py if replythread: ?>
    &#91;<a href="#{boards_url}#{board}/">Return</a>&#93;<div class="replymode">Posting mode: Reply</div>
<?py #endif ?>
    <div class="postarea">#{postarea_extra_html_top}
      <form name="postform" id="postform" action="#{cgi_url}post" method="post" enctype="multipart/form-data">
      <input type="hidden" name="board" value="#{board}">
<?py if replythread: ?>
      <input type="hidden" name="parent" value="#{replythread}">
<?py #endif ?>
      <input type="hidden" name="MAX_FILE_SIZE" value="#{MAX_FILE_SIZE}">
      <table class="postform">
        <tbody>
<?py if not forced_anonymous: ?>
          <tr>
            <td class="postblock">
              Name
            </td>
            <td>
              <input type="text" name="name" size="28" maxlength="75" accesskey="n">
            </td>
          </tr>
<?py #endif ?>
          <tr>
            <td class="postblock">
              E-mail
            </td>
            <td>
              <input type="text" name="email" size="28" maxlength="75" accesskey="e">
<?py if disable_subject or replythread: ?>
              <input type="submit" value="Submit" accesskey="z">
<?py #endif ?>
            </td>
          </tr>
<?py if not disable_subject and not replythread: ?>
          <tr>
            <td class="postblock">
              Subject
            </td>
            <td>
              <input type="text" name="subject" size="40" maxlength="75" accesskey="s">
              <input type="submit" value="Submit" accesskey="z">
            </td>
          </tr>
<?py #endif ?>
          <tr>
            <td class="postblock">
              Message
            </td>
            <td>
              <textarea name="message" cols="48" rows="4" accesskey="m"></textarea>
            </td>
          </tr>
          <tr>
            <td class="postblock">
              File<a href="?admin" style="text-decoration: none;" accesskey="x">&nbsp;</a>
            </td>
            <td>
              <input type="file" name="file" size="35" accesskey="f">
            </td>
          </tr><!--
          <tr>
            <td class="postblock">
              Options
            </td>
            <td>
              <input type="checkbox" name="aa" id="aa"><label for="aa">Fixed width font</label>
            </td>
          </tr>-->
          <tr>
            <td class="postblock">
              Password
            </td>
            <td>
              <input type="password" name="password" size="8" accesskey="p">&nbsp;(for post and file deletion)
            </td>
          </tr>
          <tr>
            <td colspan="2" class="rules">
              <ul style="margin-left: 0; margin-top: 0; margin-bottom: 0; padding-left: 0;">
                <li>Supported file types are: GIF, JPG, PNG</li>
                <li>Maximum file size allowed is #{maxsize_display}.</li>
                <li>Images greater than #{maxdimensions}x#{maxdimensions} pixels will be thumbnailed.</li>
                <li>Currently #{unique_user_posts} unique user posts.<!-- <a href="#{boards_url}{#board}/catalog.html">View catalog</a>--></li>
              </ul>
            </td>
          </tr>
        </tbody>
      </table>
      </form>
      <script type="text/javascript"><!--
      google_ad_client = "pub-6158454562572132";
      /* n7c Banner */
      google_ad_slot = "6814560090";
      google_ad_width = 468;
      google_ad_height = 60;
      //-->
      </script>
      <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
      </script>
    #{postarea_extra_html_bottom}</div>
    <script type="text/javascript"><!--
      set_inputs("postform");
    //--></script>
    <hr>
    <form id="delform" action="#{cgi_url}delete" method="post">
    <input type="hidden" name="board" value="#{board}">
<?py if threads: ?>
  <?py for thread in threads: ?>
    <?py if not replythread: ?>
    <span id="unhidethread#{thread['id']}#{board}" style="display: none;">
      Thread <a href="#{boards_url}#{board}/res/#{thread['id']}.html">#{thread['id']}</a> hidden. <a href="#" onclick="javascript:togglethread('#{thread['id']}#{board}');return false;">Show thread</a>
    </span>
    <div id="thread#{thread['id']}#{board}">
    <?py #endif ?>
    <?py for post in thread['posts']: ?>
      <?py if int(post['parentid']) != 0: ?>
      <table>
      <tbody>
      <tr>
      <td class="doubledash">
        &#0168;
      </td>
      <td class="reply" id="reply#{post['id']}">
      <?py elif post['file'] != '': ?>
      <span class="filesize">File: <a href="#{boards_url}#{board}/src/#{post['file']}" onclick="javascript:expandimg('#{post['id']}', '#{boards_url}#{board}/src/#{post['file']}', '#{boards_url}#{board}/thumb/#{post['thumb']}', '#{post['image_width']}', '#{post['image_height']}', '#{post['thumb_width']}', '#{post['thumb_height']}');return false;">#{post['file']}</a>&ndash;(#{post['file_size_formatted']}, #{post['image_width']}x#{post['image_height']})  <a href="#" title="Hide thread" onclick="javascript:togglethread('#{post['id']}#{board}');return false;" style="text-decoration: none;">&ndash;</a></span>
      <br>
      <a target="_blank" href="#{boards_url}#{board}/src/#{post['file']}">
        <span id="thumb#{post['id']}"><img src="#{boards_url}#{board}/thumb/#{post['thumb']}" alt="#{post['id']}" class="thumb" width="#{post['thumb_width']}" height="#{post['thumb_height']}"></span>
      </a>
      <?py #endif ?>
      <a name="#{post['id']}"></a>
      <label>
        <input type="checkbox" name="delete" value="#{post['id']}">
      <?py if post['subject'] != '': ?>
        <span class="filetitle">#{post['subject']}</span>
      <?py #endif ?>
        #{post['nameblock']}
      </label>
      <span class="reflink">
      <?py if replythread: ?>
        <a href="##{post['id']}" onclick="javascript:highlight('#{post['id']}');">No.</a>
        <a href="#i#{post['id']}" onclick="insert('>>#{post['id']}');">
        #{post['id']}
        </a>
      <?py else: ?>
        <?py if int(post['parentid']) != 0: ?>
        <a href="#{boards_url}#{board}/res/#{post['parentid']}.html##{post['id']}">No.</a>
        <a href="#{boards_url}#{board}/res/#{post['parentid']}.html#i#{post['id']}">
        <?py else: ?>
        <a href="#{boards_url}#{board}/res/#{post['id']}.html##{post['id']}">No.</a>
        <a href="#{boards_url}#{board}/res/#{post['id']}.html#i#{post['id']}">
        <?py #endif ?>
        #{post['id']}
        </a>
      <?py #endif ?>
      </span>
      <?py if modbrowse: ?>
      [#{post['ip']}]
      <?py #endif ?>
      <?py if int(post['parentid']) == 0: ?>
        <span class="dnb|#{board}|#{post['id']}|y"></span>
      <?py else: ?>
        <span class="dnb|#{board}|#{post['id']}|n"></span>
          <?py if post['file'] != '': ?>
      <br>
      <span class="filesize">File: <a href="#{boards_url}#{board}/src/#{post['file']}" onclick="javascript:expandimg('#{post['id']}', '#{boards_url}#{board}/src/#{post['file']}', '#{boards_url}#{board}/thumb/#{post['thumb']}', '#{post['image_width']}', '#{post['image_height']}', '#{post['thumb_width']}', '#{post['thumb_height']}');return false;">#{post['file']}</a>&ndash;(#{post['file_size_formatted']}, #{post['image_width']}x#{post['image_height']})</span>
      <br>
      <a target="_blank" href="#{boards_url}#{board}/src/#{post['file']}">
        <span id="thumb#{post['id']}"><img src="#{boards_url}#{board}/thumb/#{post['thumb']}" alt="#{post['id']}" class="thumb" width="#{post['thumb_width']}" height="#{post['thumb_height']}"></span>
      </a>
          <?py #endif ?>
      <?py #endif ?>
      <?py if int(post['parentid']) == 0 and not replythread: ?>
        &nbsp;[<a href="#{boards_url}#{board}/res/#{post['id']}.html">Reply</a>]
          <?py if post['file'] == '': ?>
           <a href="#" title="Hide thread" onclick="javascript:togglethread('#{post['id']}#{board}');return false;" style="text-decoration: none;">&ndash;</a>
          <?py #endif ?>
      <?py #endif ?>
      <blockquote>
      #{post['message']}
      </blockquote>
      <?py if int(post['parentid']) == 0: ?>
        <?py if not replythread: ?>
          <?py if int(thread['omitted']) > 0: ?>
            <span class="omittedposts">
            #{thread['omitted']}
              <?py if int(thread['omitted']) == 1: ?>
              post
              <?py else: ?>
              posts
              <?py #endif ?>
            omitted.  Click Reply to view.
          </span>
          <?py #endif ?>
        <?py #endif ?>
      <?py else: ?>
      </td>
      </tr>
      </tbody>
      </table>
      <?py #endif ?>
    <?py #endfor ?>
    </div>
    <br clear="left">
    <hr>
  <?py #endfor ?>
<?py #endif ?>
    <table class="userdelete">
      <tbody>
        <tr>
          <td>
            Delete Post [<input type="checkbox" name="imageonly" id="imageonly"><label for="imageonly">Image Only</label>]<br>Password <input type="password" name="password" size="8">&nbsp;<input name="deletepost" value="Delete" type="submit">
          </td>
        </tr>
      </tbody>
    </table>
    </form>
    <script type="text/javascript"><!--
      set_delpass("delform");
    //--></script>
<?py if page_navigator: ?>
    <table border="1">
      <tbody>
        <tr>
          #{page_navigator}
        </tr>
      </tbody>
    </table>
    <br>
<?py #endif ?>
<?py include('templates/base_bottom.html') ?>